package com.paw.qrcode.handler;

import java.util.Map;

import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import org.springframework.stereotype.Component;

/**
 * @author lvzihai
 * @date 2022/6/23
 **/
@Slf4j
@Component
public class MpMessageLogHandler implements WxMpMessageHandler {

  @Override
  public WxMpXmlOutMessage handle (WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager)
      throws WxErrorException {
    log.info("MpLogHandler {}", JSONUtil.toJsonStr(wxMessage));

    return null;
  }
}
